from django.urls import path
from django.conf.urls.static import static
from django.conf import settings

# api
from web.apis.AccountAdmin import account_admin as api_account_admin
from web.apis.CloudShop import user as CloudShopUser
from web.apis.CloudShop import CloudShop as CloudShopGoods

# 图网
# 1
from web.apis.CloudImgs1 import CloudImgs1

# 音乐
# 1
from web.apis.music import www_2t58_com

# 帖子
# 1
from web.apis.Topic.HaiJiao import HaiJiao

# 视图
from web.views import account_admin
from web.views import CloudShop
from web.views import HaiJiaoH5

urlpatterns = [
    # api

    # 帖子
    # 海角社区
    path('api/Topic/HaiJiao/get_hot_topic/', HaiJiao.get_hot_list),
    path('api/Topic/HaiJiao/get_topic_content/', HaiJiao.get_topic_content),
    path('api/Topic/HaiJiao/search_topic/', HaiJiao.search_topic),

    # 音乐

    # 线路1
    path('api/music/www_2t58_com/get_hot_music/', www_2t58_com.get_hot_music),
    path('api/music/www_2t58_com/get_actor_music/', www_2t58_com.get_actor_music),
    path('api/music/www_2t58_com/get_music_link/', www_2t58_com.get_music_link),
    path('api/music/www_2t58_com/get_video_link/', www_2t58_com.get_video_link),
    path('api/music/www_2t58_com/search_music/', www_2t58_com.search_music),
    path('api/music/www_2t58_com/get_music_rank/', www_2t58_com.get_music_rank),
    path('api/music/www_2t58_com/get_actor/', www_2t58_com.get_actor),
    path('api/music/www_2t58_com/get_songe_music_list/', www_2t58_com.get_songe_music_list),
    path('api/music/www_2t58_com/get_radio/', www_2t58_com.get_radio),
    path('api/music/www_2t58_com/get_hd_mv/', www_2t58_com.get_hd_mv),

    # 图网
    path('api/CloudImgs1/get_category/', CloudImgs1.get_category),
    path('api/CloudImgs1/get_theme/', CloudImgs1.get_pic),
    path('api/CloudImgs1/search/', CloudImgs1.search),
    path('api/CloudImgs1/get_original_pic/', CloudImgs1.get_original_pic),

    # 云商
    path('api/CloudShop/create/user/', CloudShopUser.login),  # 登录与注册
    path('api/CloudShop/user/edit/', CloudShopUser.edit_info),  # 修改个人信息
    path('api/CloudShop/tools/send_code/', CloudShopUser.send_code),  # 发送邮件
    path('api/CloudShop/add/CloudShop_Goods_Add/', CloudShopGoods.CloudShop_Goods_Add),  # 添加商品
    path('api/CloudShop/buy_goods/', CloudShopGoods.buy_goods),  # 购买商品
    path('api/CloudShop/select/CloudShop_Goods_Query/', CloudShopGoods.CloudShop_Goods_Query),  # 查询商品
    path('api/CloudShop/user/pay/yycloud/', CloudShopUser.pay_cloud),  # Yy云支付
    path('api/CloudShop/user/select/my_order/', CloudShopGoods.my_order),  # 查看我的订单
    path('api/CloudShop/user/refund/', CloudShopGoods.refund),  # 退款
    path('api/CloudShop/user/deliver/', CloudShopGoods.deliver),  # 发货
    path('api/CloudShop/user/accept/', CloudShopGoods.accept),  # 确认收货

    # 账号管理
    path('api/account_admin/create_account/', api_account_admin.create_account),  # 创建账号
    path('api/account_admin/select_account/', api_account_admin.select_account),  # 查询账号
    path('api/account_admin/edit_account/', api_account_admin.edit_account),  # 编辑账号
    path('api/account_admin/delete_account/', api_account_admin.delete_account),  # 删除账号
    path('api/account_admin/account_admin_upload/', api_account_admin.account_admin_upload),  # 上传图标

    # api

    # 视图

    # 海角H5
    path('web/HaiJiaoH5/template/', HaiJiaoH5.template),
    path('', HaiJiaoH5.index),
    path('web/HaiJiaoH5/index/', HaiJiaoH5.index),
    path('web/HaiJiaoH5/hot_category/', HaiJiaoH5.hot_category),
    path('web/HaiJiaoH5/info/', HaiJiaoH5.info),
    path('web/HaiJiaoH5/cart/', HaiJiaoH5.cart),
    path('web/HaiJiaoH5/my/', HaiJiaoH5.my),
    path('web/HaiJiaoH5/topic_detail/', HaiJiaoH5.topic_detail),  # 帖子详情
    path('web/HaiJiaoH5/watch_history/', HaiJiaoH5.watch_history),  # 观看历史

    # 云商

    path('web/CloudShop/template/', CloudShop.template),
    path('web/CloudShop/index/', CloudShop.index),
    path('web/CloudShop/product_detail/', CloudShop.product_detail),
    path('web/CloudShop/pay_result/', CloudShop.pay_result),  # 付款结果页面
    path('web/CloudShop/login_register/', CloudShop.login_register),

    # 云商后台
    path('web/CloudShop/admin/template/', CloudShop.admin_template),
    path('web/CloudShop/admin/index/', CloudShop.admin_index),
    path('web/CloudShop/admin/goods/update_goods/', CloudShop.admin_update_goods),
    path('web/CloudShop/admin/goods/show_order/', CloudShop.admin_my_order),

    # 账号管理
    # path('', account_admin.account_admin_index),
    path('web/account_admin/index/', account_admin.account_admin_index),
    path('web/account_admin/account_admin_edit/<int:nid>/', account_admin.account_admin_edit),
    path('web/account_admin/account_admin_add/', account_admin.account_admin_add),
    path('web/account_admin/account_admin_upload/', account_admin.account_admin_upload),
]
urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
